package com.satchi.hib.pojo;

import java.text.DecimalFormat;
import java.util.*;

import com.satchi.struts.ActionHelper;

/**
 * FinBalance entity. @author MyEclipse Persistence Tools
 */

public class FinBalance implements java.io.Serializable {

	private String balanceId;
	private Date writeDate;
	private Date fitmentDate;
	private String costProperty;
	private Double balancePrice;
	private Double shopArea;
	private String balanceRemark;
	private FinUser finUser;
	private FinCustomer shop;
	private FinCustomer finCustomer;
	private Date decorationDate;
	private boolean isClosed;
	private Date closeDate;
	
	public Date getDecorationDate() {
		return decorationDate;
	}

	public void setDecorationDate(Date decorationDate) {
		this.decorationDate = decorationDate;
	}
	
	public Date getCloseDate() {
		return closeDate;
	}

	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}

	public boolean getIsClosed() {
		return isClosed;
	}

	public void setIsClosed(boolean isClosed) {
		this.isClosed = isClosed;
	}

	public String getBalanceId() {
		return balanceId;
	}

	public void setBalanceId(String balanceId) {
		this.balanceId = balanceId;
	}

	public Date getWriteDate() {
		return writeDate;
	}

	public void setWriteDate(Date writeDate) {
		this.writeDate = writeDate;
	}

	public Date getFitmentDate() {
		return fitmentDate;
	}

	public void setFitmentDate(Date fitmentDate) {
		this.fitmentDate = fitmentDate;
	}

	public String getCostProperty() {
		return costProperty;
	}

	public void setCostProperty(String costProperty) {
		this.costProperty = costProperty;
	}

	public Double getShopArea() {
		return shopArea;
	}

	public void setShopArea(Double shopArea) {
		this.shopArea = shopArea;
	}

	public String getBalanceRemark() {
		return balanceRemark;
	}

	public void setBalanceRemark(String balanceRemark) {
		this.balanceRemark = balanceRemark;
	}

	public FinUser getFinUser() {
		return finUser;
	}

	public void setFinUser(FinUser finUser) {
		this.finUser = finUser;
	}

	public FinCustomer getShop() {
		return shop;
	}

	public void setShop(FinCustomer shop) {
		this.shop= shop;
	}

	public FinBalance(String balanceId, Date writeDate, Date fitmentDate,
			String costProperty, Double balancePrice, Double shopArea,
			String balanceRemark, FinUser finUser, FinCustomer shop,
			FinCustomer finCustomer) {
		super();
		this.balanceId = balanceId;
		this.writeDate = writeDate;
		this.fitmentDate = fitmentDate;
		this.costProperty = costProperty;
		this.balancePrice = balancePrice;
		this.shopArea = shopArea;
		this.balanceRemark = balanceRemark;
		this.finUser = finUser;
		this.shop = shop;
		this.finCustomer = finCustomer;
	}

	public FinBalance() {
		super();
	}

	public String getBalancePrice2() {
		DecimalFormat format = new DecimalFormat("###0.00"); 
        return format.format(balancePrice);
	}
	
	public Double getBalancePrice() {
		return balancePrice;
	}

	public void setBalancePrice(Double balancePrice) {
		this.balancePrice = balancePrice;
	}

	public FinCustomer getFinCustomer() {
		return finCustomer;
	}

	public void setFinCustomer(FinCustomer finCustomer) {
		this.finCustomer = finCustomer;
	}

	public String getShortRemark(){
		if (balanceRemark.length() > 10) {
			return balanceRemark.substring(0, 10) + "...";
		}
		return balanceRemark;
	}
}